// 1=审批中 2=待面谈 3=待总结 4=工作交接 5=人事交接 6=IT 交接 7=行政交接 8=财务清算 9=交接完成 10=已离职 11=终止离职 12=撤回申请)
// 离职列表--离职中---按钮展示情况：*************************
// 审批中，处理人有审批、发起面谈按钮，非处理人有审批详情按钮；
// 待面谈（未准备），处理人有面谈准备、修改面谈按钮，非处理人有审批详情按钮；
// 待总结（已准备），处理人有开始面谈、修改面谈准备、修改面谈按钮，非处理人有审批详情按钮；
// 工作交接，处理人有交接、审批详情按钮，非处理人有交接详情、审批详情按钮；
// 人事交接，同工作交接
// IT 交接，同工作交接
// 行政交接，同工作交接
// 财务清算，同工作交接
// 交接完成，均有交接详情、审批详情按钮；
// 离职列表--历史记录---按钮展示情况：*************************
// 已离职，均有交接详情、审批详情、打印离职证明按钮；
// 终止离职，均有审批详情按钮；
// 撤回申请，均有审批详情按钮；
export const LEAVE_STATUS_OBJ = {
    PROCESSING: 6,
    WAITING_INTERVIEW: 7,
    TO_SUMMARIZE: 8,
    WORK_HANDOVER: 1,
    PERSONNEL_HANDOVER: 2,
    IT_HANDOVER: 3,
    ADMINISTRATIVE_HANDOVER: 4,
    FINANCIAL_SETTLEMENT: 5,
    FINISH_HANDOVER: 9,
    HAVE_LEFT: 10,
    ABORT_LEFT: 11,
    WITHDRAW_APPLICATION: 12,
    HANDOVER_DETAIL: 99
};
export const LEAVE_STATUS_OBJ_TEXT = {
    [LEAVE_STATUS_OBJ.PROCESSING]: '审批中',
    [LEAVE_STATUS_OBJ.WAITING_INTERVIEW]: '待面谈',
    [LEAVE_STATUS_OBJ.TO_SUMMARIZE]: '待总结',
    [LEAVE_STATUS_OBJ.WORK_HANDOVER]: '工作交接',
    [LEAVE_STATUS_OBJ.PERSONNEL_HANDOVER]: '人事交接',
    [LEAVE_STATUS_OBJ.IT_HANDOVER]: 'IT交接',
    [LEAVE_STATUS_OBJ.ADMINISTRATIVE_HANDOVER]: '行政交接',
    [LEAVE_STATUS_OBJ.FINANCIAL_SETTLEMENT]: '财务清算',
    [LEAVE_STATUS_OBJ.FINISH_HANDOVER]: '交接完成',
    [LEAVE_STATUS_OBJ.HAVE_LEFT]: '已离职',
    [LEAVE_STATUS_OBJ.ABORT_LEFT]: '终止离职',
    [LEAVE_STATUS_OBJ.WITHDRAW_APPLICATION]: '撤回申请'
};
export const LEAVE_STATUS = [
    {
        value: LEAVE_STATUS_OBJ.PROCESSING,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.PROCESSING],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 1
    },
    {
        value: LEAVE_STATUS_OBJ.WAITING_INTERVIEW,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.WAITING_INTERVIEW],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 1
    },
    {
        value: LEAVE_STATUS_OBJ.TO_SUMMARIZE,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.TO_SUMMARIZE],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 1
    },
    {
        value: LEAVE_STATUS_OBJ.WORK_HANDOVER,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.WORK_HANDOVER],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 1
    },
    {
        value: LEAVE_STATUS_OBJ.PERSONNEL_HANDOVER,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.PERSONNEL_HANDOVER],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 1
    },
    {
        value: LEAVE_STATUS_OBJ.IT_HANDOVER,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.IT_HANDOVER],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 1
    },
    {
        value: LEAVE_STATUS_OBJ.ADMINISTRATIVE_HANDOVER,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.ADMINISTRATIVE_HANDOVER],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 1
    },
    {
        value: LEAVE_STATUS_OBJ.FINANCIAL_SETTLEMENT,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.FINANCIAL_SETTLEMENT],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 1
    },
    {
        value: LEAVE_STATUS_OBJ.FINISH_HANDOVER,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.FINISH_HANDOVER],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 1
    },
    {
        value: LEAVE_STATUS_OBJ.HAVE_LEFT,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.HAVE_LEFT],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 2
    },
    {
        value: LEAVE_STATUS_OBJ.ABORT_LEFT,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.ABORT_LEFT],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 2
    },
    {
        value: LEAVE_STATUS_OBJ.WITHDRAW_APPLICATION,
        text: LEAVE_STATUS_OBJ_TEXT[LEAVE_STATUS_OBJ.WITHDRAW_APPLICATION],
        color: ' rgba(0, 0, 0, 0.65)',
        background: '#FAFAFA',
        type: 2
    }
];
export const LEAVE_TYPE = [
    {
        value: 1,
        text: '主动离职'
    },
    {
        value: 2,
        text: '被动离职'
    }
];
// 获取配置
export const getOperate = (record, key, onClick) => {
    console.log();
    const obj = {
        // 审批
        approve: {
            url: '',
            code: true,
            query: {},
            iconType: 'yijianrenling',
            title: '审批',
            onClick: onClick || undefined
        },
        // 审批详情
        approveDetail: {
            url: '',
            code: true,
            query: {},
            iconType: 'chakanfabuxinxi',
            title: '查看审批详情',
            onClick: onClick || undefined
        },
        // 修改面谈准备
        modifyInterviewPreparation: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/talk/prepare',
            // code: 'office:personnel:onboardandleave:leave:talk:prepare',
            code: true,
            query: {
                arrangeId: record?.arrangeId,
                employeeCode: record?.employeeCode,
                interviewRefCode: record?.dimissionCode
            },
            iconType: 'tijiaozhaopinxuqiu',
            title: '修改面谈准备',
            onClick: onClick || undefined,
            jumpType: 2
        },
        // 发起面谈 -- 侧滑窗
        initiateInterview: {
            url: '',
            code: true,
            query: {},
            iconType: 'faqimiantan',
            title: '发起面谈',
            onClick: onClick || undefined
        },
        // 开始面谈（面谈记录）
        startInterview: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/talk/record',
            // code: 'office:personnel:onboardandleave:leave:talk:record',
            code: true,
            query: {
                arrangeId: record?.arrangeId,
                employeeCode: record?.employeeCode,
                interviewRefCode: record?.dimissionCode
            },
            iconType: 'kaishimiantan2',
            title: '开始面谈',
            onClick: onClick || undefined,
            jumpType: 2
        },
        // 面谈准备
        preparingInterview: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/talk/prepare',
            // code: 'office:personnel:onboardandleave:leave:talk:prepare',
            code: true,
            query: {
                arrangeId: record?.arrangeId,
                employeeCode: record?.employeeCode,
                interviewRefCode: record?.dimissionCode
            },
            iconType: 'kaishimiantan',
            title: '面谈准备',
            onClick: onClick || undefined,
            jumpType: 2
        },
        // 修改面谈-- 侧滑窗
        editInterview: {
            url: '',
            code: true,
            query: {
                id: record?.id
            },
            iconType: 'bianji1',
            title: '修改面谈',
            onClick: onClick || undefined
        },
        // 面谈总结
        interviewSummary: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/talk/conclusion',
            // code: 'office:personnel:onboardandleave:leave:talk:conclusion',
            code: true,
            query: {
                arrangeId: record?.arrangeId,
                employeeCode: record?.employeeCode,
                interviewRefCode: record?.dimissionCode
            },
            iconType: 'listfunction_edit_icon_default',
            title: '面谈总结',
            onClick: onClick || undefined,
            jumpType: 2
        },
        // 交接详情
        handoverDetail: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/handover_detail',
            // code: 'office:personnel:onboardandleave:leave:handover:detail',
            code: true,
            query: {
                dimissionOrderId: record?.id,
                employeeCode: record?.employeeCode
            },
            iconType: 'chakanxiangqing',
            title: '查看交接详情',
            onClick: onClick || undefined,
            jumpType: 1
        },
        // 修改处理人
        modificationHandler: {
            url: '',
            code: true,
            query: {
                id: record?.id
            },
            iconType: 'xiugaifuzeren1',
            title: '修改处理人',
            onClick: onClick || undefined
        },
        // 工作交接
        workHandover: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/handover',
            // code: 'office:personnel:onboardandleave:leave:workhandover',
            code: true,
            query: {
                dimissionOrderId: record?.id,
                employeeCode: record?.employeeCode,
                type: LEAVE_STATUS_OBJ.WORK_HANDOVER
            },
            iconType: 'gongzuojiaojie',
            title: '工作交接',
            onClick: onClick || undefined,
            jumpType: 1
        },
        // 人事交接
        personnelHandover: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/handover',
            // code: 'office:personnel:onboardandleave:leave:personnelhandover',
            code: true,
            query: {
                dimissionOrderId: record?.id,
                type: LEAVE_STATUS_OBJ.PERSONNEL_HANDOVER,
                employeeCode: record?.employeeCode
            },
            iconType: 'renshijiaojie1',
            title: '人事交接',
            onClick: onClick || undefined,
            jumpType: 1
        },
        // IT交接
        itHandover: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/handover',
            // code: 'office:personnel:onboardandleave:leave:ithandover',
            code: true,
            query: {
                dimissionOrderId: record?.id,
                type: LEAVE_STATUS_OBJ.IT_HANDOVER,
                employeeCode: record?.employeeCode
            },
            iconType: 'ITjiaojie1',
            title: 'IT交接',
            onClick: onClick || undefined,
            jumpType: 1
        },
        // 行政交接
        administrativeHandover: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/handover',
            // code: 'office:personnel:onboardandleave:leave:admhandover',
            code: true,
            query: {
                dimissionOrderId: record?.id,
                type: LEAVE_STATUS_OBJ.ADMINISTRATIVE_HANDOVER,
                employeeCode: record?.employeeCode
            },
            iconType: 'hangzhengjiaojie2',
            title: '行政交接',
            onClick: onClick || undefined,
            jumpType: 1
        },
        // 财务清算
        financialHandover: {
            url: '/office/personnelManagement/onboardAndLeave/leaveManagement/handover',
            // code: 'office:personnel:onboardandleave:leave:financial',
            code: true,
            query: {
                dimissionOrderId: record?.id,
                type: LEAVE_STATUS_OBJ.FINANCIAL_SETTLEMENT,
                employeeCode: record?.employeeCode
            },
            iconType: 'caiwuqingsuan1',
            title: '财务清算',
            onClick: onClick || undefined,
            jumpType: 1
        },
        // 打印离职证明
        printCertificate: {
            url: '',
            code: true,
            query: {},
            iconType: 'tarentiaogangshenqing1',
            title: '打印离职证明',
            onClick: onClick || undefined
        }
    };
    return obj[key];
};

export const HANDOVER_PATH = {
    [LEAVE_STATUS_OBJ.WORK_HANDOVER]: '/office/personnelManagement/onboardAndLeave/leaveManagement/work_handover',
    [LEAVE_STATUS_OBJ.PERSONNEL_HANDOVER]:
        '/office/personnelManagement/onboardAndLeave/leaveManagement/personnel_handover',
    [LEAVE_STATUS_OBJ.IT_HANDOVER]: '/office/personnelManagement/onboardAndLeave/leaveManagement/it_handover',
    [LEAVE_STATUS_OBJ.ADMINISTRATIVE_HANDOVER]:
        '/office/personnelManagement/onboardAndLeave/leaveManagement/administrative_handover',
    [LEAVE_STATUS_OBJ.FINANCIAL_SETTLEMENT]:
        '/office/personnelManagement/onboardAndLeave/leaveManagement/financial_settlement'
};
